package com.glela.dv.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tk.mybatis.mapper.entity.Example;

import com.github.pagehelper.PageHelper;
import com.glela.dv.dao.IKRegActAllDao;
import com.glela.dv.model.KRegActAll;
import com.glela.dv.service.IKRegActAllService;

/**
 * @author liujie
 * @date 2016年4月14日
 *
 */
@Service("kRegActAllService")
public class KRegActAllService extends AbstractSummaryService<KRegActAll> implements IKRegActAllService{

	@Autowired
	IKRegActAllDao kRegActAllDao;
	
	@Override
	public List<KRegActAll> queryByKRegActAll(KRegActAll kRegActAll,int page,int rows) {

		Example example = new Example(KRegActAll.class);
		Example.Criteria criteria = example.createCriteria();
		if (kRegActAll.getReacordDay() != null) {
			criteria.andEqualTo("reacordDay", kRegActAll.getReacordDay());
		}
		if (rows > 0) {
			PageHelper.startPage(page, rows);
		}
		return queryByExample(example);

	}
	
	protected Class<?> getClazz()
	{
		return KRegActAll.class;
	}
}
